import random

import requests

api_key = '88V8D6Nt9hHk974-5ek31Czx-vVX7QVeL-5pfX7QzQ-f5wRvdDwScF3WQb'


def get_phone(product, countries):
    if isinstance(countries, list):
        country = random.choice(countries)
    else:
        country = countries
    r = requests.get(f'https://onlinesim.io/api/getNum.php?service={product}&country={country}&number=true&apikey={api_key}')
    print(r.status_code, r.text)
    if r.status_code == 200:
        pass

def get_sms(phone):
    pass


if __name__ == '__main__':
    get_phone('facebook', 7)